package day20.feifei;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class ExecutorsPool {
    public static void main(String[] args) {
        //闯进一个含有三个固定县城的线程池
        ExecutorService executorService = Executors.newFixedThreadPool(3);
//执行submint()方法
        for(int j=0;j<10;j++){
            Future<?> future = executorService.submit(new Runnable() {
                @Override
                public void run() {
                    for (int i = 0; i <5; i++) {
                        System.out.println(Thread.currentThread().getName()+"---->"+i);
                    }
                }
            });
        }
    executorService.shutdown();
    }

}
